Added file missed on commit of earlier patch by Dan Smith.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 8 Nov 2005 11:30:38 +0000 (12:30 +0100)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 8 Nov 2005 11:30:38 +0000 (12:30 +0100)
tools/xm-test/tests/help/06_help_allcmds.py [new file with mode: 0644]

diff --git a/tools/xm-test/tests/help/06_help_allcmds.py b/tools/xm-test/tests/help/06_help_allcmds.py
new file mode 100644 (file)
index 0000000..6fbc0b4
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@us.ibm.com>
+
+from XmTestLib import *
+
+import re
+
+MAX_ARGS = 10
+
+# These commands aren't suitable for this test, so we
+# ignore them
+skipcommands = ["top", "log"]
+
+status, output = traceCommand("xm help --long")
+
+commands = []
+badcommands = []
+
+lines = output.split("\n")
+for l in lines:
+    match = re.match("^    ([a-z][^ ]+).*$", l)
+    if match:
+        commands.append(match.group(1))
+
+for c in commands:
+    if c in skipcommands:
+        continue
+
+    arglist = ""
+    for i in range(0,MAX_ARGS+1):
+        if i > 0:
+            arglist += "%i " % i
+
+        status, output = traceCommand("xm %s %s" % (c, arglist))
+
+        if output.find("Traceback") != -1:
+            badcommands.append(c + " " + arglist)
+            if verbose:
+                print "Got Traceback: %s %s" % (c, arglist)
+
+if badcommands:
+    FAIL("Got a traceback on: %s" % str(badcommands))